//---------------------------------------------------------------------------- Strict
'use strict'
//---------------------------------------------------------------------------- Package
const _ = require('lodash')
const path = require('path')
//---------------------------------------------------------------------------- Library
const file = require('../library/io/file')
//---------------------------------------------------------------------------- Exports
module.exports = function () {
  
  // 声明dir并取其下所有文件（index.js除外）
  let files = file.getFiles(__dirname)

  // 声明routers，并将取回的文件放入routers
  let routers = []
  for (let value of files) {
    _.merge(routers, require(value))
  }

  // 返回制作好的routers
  return routers
}
